<%-- 
    Document   : registraSancion
    Created on : 12/06/2009, 05:08:34 PM
    Author     : ADMINISTRADOR
--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<%@taglib prefix="r" uri="http://richfaces.ajax4jsf.org/rich" %>
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>

<script language="javascript" src="../js/funciones.js"></script>
<link href="/colegiatura/Estilos/estilosEsymons.css" rel="stylesheet" type="text/css" />

<f:view>
    <h:form enctype="multipart/form-data">
    <table width="100%" border="0">
      <tr>
          <td align="left" class="texto3" height="30">Registro de Sanciones a Colegiados </td>
      </tr>
      <tr><td height="20">
     <a4j:outputPanel ajaxRendered="true">
    <h:messages id="lblMessages" styleClass="messages" infoClass="infoClass" errorClass="errorClass"
                warnClass="warnClass" showDetail="true" errorStyle="color:red;"
                warnStyle="color:green;" infoStyle="color:black;" fatalStyle="color:black"/>
    </a4j:outputPanel>
      </td>
  </tr>
       <h:panelGroup rendered="#{sancionarController.activo==false}" >
      <tr><td>
      <fieldset>
          <legend>Buscar CIP</legend>
          <table width="900" border="0">
          <tr>
        <td width="150">&nbsp;</td>
        <td width="140" height="25"  align="left"><h:outputLabel value="Nro CIP :" styleClass="texto20" /></td>
        <td align="left"><h:inputText value="#{sancionarController.codigoCip}" size="20" styleClass="fondo012" />
            <h:commandButton action="#{sancionarController.buscaPorNroCip}" value=" Buscar" styleClass="enlace9" /></td>
        </tr>
          </table>
      </fieldset>
      </td>
      </tr>
     <tr><td>
      <fieldset>
          <legend>Buscar Colegiado</legend>
          <table width="900" border="0">
          <tr>
        <td width="150">&nbsp;</td>
        <td width="140" height="25"  align="left"><h:outputLabel value="DNI :" styleClass="texto20" /></td>
        <td width="213" align="left"><h:inputText value="#{sancionarController.dni}"  styleClass="fondo012" /></td>
        <td width="86" align="left"></td>
        <td width="50" align="left">&nbsp;</td>
        <td width="34">&nbsp;</td>
        <td width="197">&nbsp;</td>
      </tr>
      <tr>
        <td width="150">&nbsp;</td>
        <td width="140" height="25"  align="left"><h:outputLabel value="Nombres:" styleClass="texto20" /></td>
        <td width="213" align="left"><h:inputText value="#{sancionarController.nombres}"  styleClass="fondo012" /></td>
        <td width="86" align="left"></td>
        <td width="50" align="left">&nbsp;</td>
        <td width="34">&nbsp;</td>
        <td width="197">&nbsp;</td>
      </tr>
      <tr>
        <td width="150">&nbsp;</td>
        <td width="140" height="25"  align="left"><h:outputLabel value="Apellido Paterno:" styleClass="texto20" /></td>
        <td width="213" align="left"><h:inputText value="#{sancionarController.apePaterno}"  styleClass="fondo012" /></td>
        <td width="86" align="left"></td>
        <td width="50" align="left">&nbsp;</td>
        <td width="34">&nbsp;</td>
        <td width="197">&nbsp;</td>
      </tr>
      <tr>
        <td width="150">&nbsp;</td>
        <td width="140" height="25"  align="left"><h:outputLabel value="Apellido Materno:" styleClass="texto20" /></td>
        <td width="213" align="left"><h:inputText value="#{sancionarController.apeMaterno}" styleClass="fondo012" /></td>
        <td colspan="2" align="left">
        <h:commandButton action="#{sancionarController.buscarColegiado}" value=" Buscar " styleClass="enlace9" /></td>
        <td width="34">&nbsp;</td>
        <td width="197">&nbsp;</td>
      </tr>
          </table>
      </fieldset>
      </td>
      </tr>
      <tr><td>
       <table width="906" border="0">
            <tr><td width="916">
      <r:panel rendered="#{sancionarController.listaPersonasFotos!=null}">
        <f:facet name="header">
            <h:outputLabel value="Colegiados" />
        </f:facet>
      <r:dataGrid rendered="#{sancionarController.listaPersonasFotos!=null}" value="#{sancionarController.listaPersonasFotos}" var="colegiado"
        rowKeyVar="fotin" width="100%" columns="3" elements="9" >
        <f:facet name="header">
            <r:datascroller></r:datascroller>
        </f:facet>
        <r:panel bodyClass="pbody">
            <f:facet name="header">
                <h:outputLabel value="Nro CIP: #{colegiado.numeroCIP}" styleClass="texto22" />
            </f:facet>
            <h:panelGrid columns="2" >
             <h:graphicImage rendered="#{colegiado.foto.cimRuta==null}" url="/imagenColegiatura/sinFoto.jpg" alt="Foto" height="63" width="43" />
             <a4j:mediaOutput rendered="#{colegiado.foto.cimRuta!=null}" value="#{fotin}" element="img" session="true" align="middle"
              createContent="#{sancionarController.drawImagenListaFotos}" mimeType="image/jpg" styleClass="imagenFotoChica" />
                <h:panelGrid columns="2" >
                    <h:outputLabel value="Ap.Paterno: " styleClass="texto22"/>
                    <h:outputLabel value="#{colegiado.perapellidoPaterno}" styleClass="texto20"/>
                    <h:outputLabel value="Ap.Materno: " styleClass="texto22"/>
                    <h:outputLabel value="#{colegiado.perapellidoMaterno}" styleClass="texto20"/>
                    <h:outputLabel value="Nombres: " styleClass="texto22"/>
                    <h:outputLabel value="#{colegiado.perNombres} " styleClass="texto20"/>
                    <h:commandLink action="#{sancionarController.seleccionar}" value="Seleccionar" styleClass="seleccion" >
                      <f:setPropertyActionListener target="#{sancionarController.persona}" value="#{colegiado}" />
                    </h:commandLink>
                    <h:outputLabel value="" />
                </h:panelGrid>                
            </h:panelGrid>
        </r:panel>
        <f:facet name="footer">
        <r:datascroller></r:datascroller>
        </f:facet>
    </r:dataGrid>
  </r:panel>
  </td>
  </tr> </table>
 </td></tr>
 </h:panelGroup>
  <h:panelGroup rendered="#{sancionarController.activo==true}" >
   <tr><td>
      <fieldset>
          <legend>Datos Colegiado</legend>
          <table width="900" border="0">
          <tr>
        <td width="89">&nbsp;</td>
        <td width="140"><h:outputLabel value="Tipo Colegiado :" styleClass="texto20" />    </td>
        <td width="262" align="left">
            <h:outputLabel value="#{transfController.colegiado.tipoColegiado.tcoNombre}" styleClass="texto12" /></td>
        <td width="391" align="center"><fieldset><legend>Historial</legend>
	   <table width="389"  border="0">
	   <tr><td width="383" align="center">
           <h:commandButton action="#{sancionarController.ListarSancion}" value="Ver Sanciones" styleClass="enlace9"/>
           <h:commandButton action="#{jasperController.reporteSancionesColegiado}" value="Generar PDF" styleClass="enlace9" />
		   </td>
	   </tr>
		   </table></fieldset></td>
          </tr>
     <tr>
        <td>&nbsp;</td>
        <td  width="140" height="25" align="left"><h:outputLabel value="Nombre :" styleClass="texto20" /></td>
        <td colspan="3" align="left">
            <h:outputLabel value="#{sancionarController.colegiado.personaNatural.nombreCompleto}" styleClass="texto12" /></td>
       </tr>
      <tr>
        <td >&nbsp;</td>
        <td width="140"  height="25" align="left"><h:outputLabel value="Especialidad :" styleClass="texto20" /></td>
        <td colspan="3" align="left">
            <h:outputLabel value="#{sancionarController.colEsp.ecaCodigo.espCodigo.espDescripcion}"  styleClass="texto12" /></td>
        </tr>
      <tr>
        <td height="24">&nbsp;</td>
        <td height="25"  align="left"><h:outputLabel value="Capítulo : " styleClass="texto20" /></td>
        <td  align="left" colspan="3">
            <h:outputLabel value="#{sancionarController.colEsp.ecaCodigo.capCodigo.capDescripcion}" styleClass="texto12"  /></td>
        </tr>
        </table>
      </fieldset>
       </td></tr>
     <tr><td>
      <fieldset>
          <legend>Sanciones</legend>
          <table width="900" border="0">
          <tr><td width="140">&nbsp;</td>
        <td width="160" height="25"  align="left"><h:outputLabel value="Sanción : " styleClass="texto20" /></td>
        <td  align="left" colspan="3">
            <h:selectOneMenu value="#{sancionarController.detSancion.sanCodigo}" styleClass="fondo012">
                <f:selectItem itemLabel="---Seleccionar---" />
                <f:selectItems value="#{sancionarController.selectListaItemSancion}" />
            </h:selectOneMenu></td>
        <td width="218">&nbsp;</td>
      </tr>
      <tr><td>&nbsp;</td>
        <td height="25"  align="left"><h:outputLabel value="Nro. Documento : " styleClass="texto20" /></td>
        <td  align="left" colspan="4">
          <h:inputText value="#{sancionarController.numeroDocumento}" size="50" styleClass="fondo012" />
          <h:commandButton action="#{sancionarController.buscarDocumento}" value="Buscar" styleClass="enlace9"/></td>
        </tr>
      <tr><td>&nbsp;</td>
        <td height="25"  align="left"><h:outputLabel value="Documento Ref. : " styleClass="texto20" /></td>
        <td  align="left" colspan="4">
            <h:inputText value="#{sancionarController.detSancion.dsaDocumento}" size="50" styleClass="fondo012" /> </td>
     </tr>
      <tr><td colspan="6" height="25" ></td></tr>
      <tr>
        <td>&nbsp;</td>
        <td height="25"  align="left"></td>
        <td align="right"></td>
        <td colspan="3" align="center">
		<h:commandButton action="#{sancionarController.sancionar}" value="Registrar" styleClass="enlace9" />
		<h:commandButton action="#{sancionarController.limpiar}" value="Cancelar" styleClass="enlace9" /></td>
      </tr>
          </table>
      </fieldset>
       </td></tr>     
      </h:panelGroup>
    </table>
    </h:form>
</f:view>